package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;

import com.itheima.entity.Result;
import com.itheima.service.SetMealService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("setmeal")
public class SetMealController {
    @Reference(version = "1.0")
    SetMealService setMealService;

    @PostMapping("getSetmeal")
    public Result getSetmeal() {
        return setMealService.findAll();
    }

    @PostMapping("findById")
    public Result findById(Integer id) {
        return setMealService.findSetMealById(id);
    }

    @GetMapping("gen")
    public Result gen(){
        return setMealService.gen();
    }
}
